home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
networke
/
civ-0.000
/
civ-0
/
civ-0.3
/
src
/
player.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-19
|
2KB
|
106 lines
#ifndef _PLAYER_H
#define _PLAYER_H
#include "list.h"
class MsgQ;
class Unit;
// MarkM added ANARCHY to govt types enumeration:
enum { ANARCHY, DESPOT, MONARCH, REPUBLIC, DEMOCRACY };
class City;
class Player
{
public:
Player(char *Name, int Id);
~Player();
char *name;
char color1Str[40], color2Str[40]; // for fast color switching
int id;
List<ulong> citys;
List<ulong> units;
long cityPic; // compiled city pic
int govt; // government type
int tax;
// MarkM added luxuries rate:
int luxuries;
int money;
int scienceAcc;
int needScience;
char *researching;
List<charp> discovered;
List<charp> canDiscover;
List<charp> canBuild;
List<charp> wonders;
// MarkM added canGovern list of possible government types
List<charp> canGovern;
int templeEffect, cathedralEffect, seamoveBonus, tradeBonus;
List<charp> messages; // any messages we wan't to show in city turn
// create the first unit and start up the player, will also send
// out the info for this unit to all other players
void Setup();
// send all the moves we made in this turn
void SendMoves(MsgQ *);
// get all moves a remote player made
void ShowMoves(MsgQ *, MsgQ *outQ);
void InitMoveTurn();
void MoveTurnMesg(MsgQ *);
void MoveTurnKey(int event, int x, int y, char *data);
void InitCityTurn();
void CityTurnMesg(MsgQ *);
void CityTurnKey(int event, int x, int y, char *data);
void UpdateCities();
long CompilePic(char **pic);
void WonderEffect(City *city);
int HasWonder(char *name);
void DeleteWonder(char *name);
// saves everything to save file
void Save();
void Restore(); // restore from save file
private:
enum { NORMAL, IN_SELECT };
enum { SCIENCE, TAX_RATE, LUXURY_RATE, REVOLUTION, GOVERNMENT_TYPE,
BUILD_BUY, CITY_BUILDING };
int state, selecting;
int initiatedSave; // if save initiated
MsgQ *unDispQ; // undisplayed moves
int doneMoving; // true if he's told us he's done moving
int acks_left; // number of acks remaining
int accepts_left; // number of accepts outstanding
Unit *currUnit; // currently selected unit
City *FindCityWithMsg();
void ChooseGovernment();
void SelectEvent(int event, int x, int y, char *data);
};
typedef Player *PlayerP;
#endif